package config


import (
	k8sclient "k8s_gui_client/k8s/client"
)

//LimitRange list
func GetLimitRanges(namespace string) (map[string]interface{}, error) {

	if namespace != "" {
		return k8sclient.CurrentK8sApiClient.GetAPI("/api/v1/namespaces/" + namespace + "/limitranges")
	} else {
		return k8sclient.CurrentK8sApiClient.GetAPI("/api/v1/limitranges")

	}

}

func LimitRangeURL(namespace string, name string) string {
	return "/api/v1/namespaces/" + namespace + "/limitranges/" + name
}

func GetLimitRangeYaml(namespace string,name string) (string ,error){
    return k8sclient.CurrentK8sApiClient.GetAPIAsYaml(LimitRangeURL(namespace,name))
}